#!/usr/bin/env python
# Copyright (C) 2007 by Xyhthyx <xyhthyx@gmail.com>

# This file is part of Parcelle.

# Parcelle is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.

# Parcelle is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import gtk.glade
import common

# Generates the about dialog
class AboutDialog:
	
	def __init__(self):
		
		# Set the Glade file
		self.gladefile = gtk.glade.XML(common.ABOUT_GLADE_FILE, common.ABOUT_FORM_NAME)
		
		# Form widget
		self.frmAbout = self.gladefile.get_widget(common.ABOUT_FORM_NAME)
		
		# Edit about form
		self.frmAbout.set_name('Parcelle')
		icon = self.frmAbout.render_icon(gtk.STOCK_ABOUT, gtk.ICON_SIZE_MENU)
		self.frmAbout.set_icon(icon)
		self.frmAbout.set_version('1.2.1')
	
	# Run the about dialog and return result
	def run(self):
		
		# Run the dialog and store the response      
		result = self.frmAbout.run()
		
		# Destroy the dialog after it's finished
		self.frmAbout.destroy()
		
		# Return the result
		return result
